package com.weiyi.weiman;

import com.weiyi.weiman.client.AppletCanalClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

@MapperScan("com.weiyi.weiman.mapper")
@SpringBootApplication(scanBasePackages="com.weiyi.weiman")
public class AdminApplication implements CommandLineRunner {

    @Resource
    private AppletCanalClient appletCanalClient;

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

    @Override
    public void run(String... strings) throws Exception {
        //项目启动，执行canal客户端监听
        appletCanalClient.run();
    }

}
